Adwaita: dropdown styling
authorJakub Steiner <jimmac@gmail.com>
Mon, 15 Jun 2020 13:18:04 +0000 (15:18 +0200)
committerJakub Steiner <jimmac@gmail.com>
Tue, 16 Jun 2020 19:11:28 +0000 (21:11 +0200)
- selected item color
- offset dropdown form the parent control
- special styling for the top search entry

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2846

gtk/theme/Adwaita/_common.scss

index 35e9010b6ca1aba8cc68c1d2876edf3d758efe60..cbc23b5b3631488843512b00e533a7b7e0c789a4 100644 (file)
@@ -1152,6 +1152,8 @@ spinbutton {
 /**************
  * ComboBoxes *
  **************/
+dropdown > popover.menu.background > contents { padding: 0; } //allow search entries with no margin
+
 dropdown,
 combobox {
   arrow {
@@ -1178,12 +1180,36 @@ combobox {
 
     button.combo { @extend %button_basic_drop_active; }
   }
-}
 
-dropdown > popover listview > row {
-  padding: 6px;
+  // newstyle
+  popover {
+   margin-top: 6px;
+   padding: 0;
+
+   listview {
+
+      margin: 8px 0;
+
+      &>row {
+         padding: 8px;
+
+         &:selected {
+           outline-color: $alt_focus_border_color;
+           color: $text-color;
+           background-color: $menu_selected_color;
+         }
+      }
+   }
+
+    .search { //drodowns with searchboxes on top
+      border-radius: $popover_radius $popover_radius 0 0;
+      padding: 3px 10px;
+      margin-top: -2px; //paint over the menu borders
+    }
+  }
 }
 
+
 // the combo is a composite widget so the way we do button linking doesn't
 // work, special case needed. See
 // https://bugzilla.gnome.org/show_bug.cgi?id=733979